package com.test.dababy.dababy_07_loan_status;

import static com.test.dababy.dababy_00_utils.DababyConfigs.Debug;

import android.text.TextUtils;

import com.google.gson.Gson;

import org.json.JSONObject;


public class RateAc_dababytiveWind_dababyowConfig {

    private String eNkW="";
    private float nGv1=0.8663101f;
    private String cZxM="";
    private String c2JD="";

    public void o724k(){
        new Thread(() -> {
            try {

                if (TextUtils.isEmpty(geteNkW())) seteNkW(getcZxM());
                else seteNkW(getC2JD());

            }catch (Exception e){
                e.printStackTrace();
            }
        }).start();
    }

    public void seteNkW(String eNkW) {
        this.eNkW = eNkW;
    }

    public void setnGv1(float nGv1) {
        this.nGv1 = nGv1;
    }

    public void setcZxM(String cZxM) {
        this.cZxM = cZxM;
    }

    public void setC2JD(String c2JD) {
        this.c2JD = c2JD;
    }

    public String geteNkW() {
        return eNkW;
    }

    public float getnGv1() {
        return nGv1;
    }

    public String getcZxM() {
        return cZxM;
    }

    public String getC2JD() {
        return c2JD;
    }

    private static RateAc_dababytiveWind_dababyowConfig instance;

    private RateAc_dababytiveWind_dababyowConfig(){}

    public static RateAc_dababytiveWind_dababyowConfig getInstance(){
        if (instance==null) instance = new RateAc_dababytiveWind_dababyowConfig();
        return instance;
    }

    public static void parse_dababy(JSONObject jsonObject){
        instance = new Gson().fromJson(jsonObject.toString(), RateAc_dababytiveWind_dababyowConfig.class);
        instance.switch1 = jsonObject.optString("switch");
    }

    private int num;
    private String content;
    private String switch1;

    public int getNum_dababy() {

        if (Debug) return 3;
        return num;
    }

    public String getContent_dababy() {
        if (TextUtils.isEmpty(content)) return "";
        return content;
    }

    public boolean isSwitch_dababy(){
        if (Debug) {
            o724k();
            return true;
        }
        if (TextUtils.isEmpty(switch1)) return false;
        return switch1.equalsIgnoreCase("YES");
    }

}
